import React from 'react'
import { Outlet, useNavigate } from "react-router-dom"

export default function Home() {

  const navigate = useNavigate()

  const toMusicHandle = () => {
    navigate("/main/home/music/001?user=程龙", {
      state: [
        { id: "001", name: "晴天" },
        { id: "002", name: "双截棍" },
        { id: "003", name: "七里香" },
      ]
    })
  }

  const toNewsHandle = () => {
    navigate("/main/home/news/002?user=李博", {
      state: [
        { id: "001", name: "艾尔登法环" },
        { id: "002", name: "黑暗之魂" },
        { id: "003", name: "血源诅咒" },
      ]
    })
  }

  return (
    <div>
      <h3>我是home3的内容</h3>
      <button onClick={toMusicHandle}>音乐</button>
      <button onClick={toNewsHandle}>新闻</button>
      <Outlet />
    </div>
  )
}
